ps -aux | grep lx | grep ./main > file 
ps -aux | grep lx | grep ./car_detect >> file
ps -aux | grep lx | grep ./car_lpd >> file  
ps -aux | grep lx | grep ./car_lpr >> file  
ps -aux | grep lx | grep ./lab1 >> file  
ps -aux | grep lx | grep ./lab2 >> file
ps -aux | grep lx | grep ./lab3 >> file  
ps -aux | grep lx | grep ./lab4 >> file
ps -aux | grep lx | grep ./lab5 >> file  
ps -aux | grep lx | grep ./lab6 >> file
ps -aux | grep lx | grep test.py >> file
awk '{print $2}' file > out
awk '{print "kill -9 "$0}' out > cmd
source cmd
rm file out cmd
echo "kill z status process success."

ipcs -m | grep lx > file
echo 'total num: '
ipcs -m | grep lx | wc -l
awk '{print $2}' file > out
awk '{print "ipcrm -m "$0}' out > cmd
echo 'command write to file.'
source cmd
echo 'command file execute completed.'
rm file out cmd
echo 'clear shared memory success.'
